﻿<UserControl x:Class="Skynet.Administracion.Views.ExamCategoryMgm.ExamCategoryMgmView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"              
             xmlns:infControls="clr-namespace:Infrastructure.WpfClient.Controls;assembly=Infrastructure.WpfClient"
             xmlns:infValidators="clr-namespace:Infrastructure.WpfClient.ValidationRules;assembly=Infrastructure.WpfClient"
             xmlns:entities="clr-namespace:Skynet.BusinessEntities;assembly=Skynet.BusinessEntities"
             xmlns:local="clr-namespace:Skynet.Administracion.Views.ExamCategoryMgm"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="450"
              Loaded="UserControl_Loaded"
             x:Name="CategoriaExamenMgmView1">    
    <UserControl.CommandBindings>
        <CommandBinding Command="local:ExamCategoryMgmView.NewCommand" Executed="CommandBinding_Executed"></CommandBinding>
    </UserControl.CommandBindings>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
            <ColumnDefinition Width="*"></ColumnDefinition>
        </Grid.ColumnDefinitions>        
        <Grid.RowDefinitions>
            <RowDefinition Height="40" ></RowDefinition>
            <RowDefinition Height="*" ></RowDefinition>
        </Grid.RowDefinitions>
               
        
        <infControls:MgmtPanelControl 
            Name="mgmtPanelcontrol1"
            ShowSave="Collapsed"                         
            Grid.Row="0"  Grid.ColumnSpan="2"
            CurrentCollection="{Binding Categorias}" 
            NewCommand="local:ExamCategoryMgmView.NewCommand"
            ShowConfirmDelete="True"
            DeleteCommand="{Binding Path=DeleteCommand}"                          
            DeleteCommandParameter="{Binding ElementName=categoriaExamDataGrid, Path=SelectedItem}"
            CloseCommand="{Binding CloseCommand}"/>
      
        
        <Expander Name="MaintenanceExpander"   Grid.Row="1" Grid.Column="0" ExpandDirection="Right" Header="Operations" IsExpanded="False">
            <GroupBox Header="Create Usuario">
                <Grid HorizontalAlignment="Left" Name="grid1" VerticalAlignment="Top">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>

                    <Label Content="Title:" Grid.Column="0" Grid.Row="1" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />
                    <TextBox Grid.Column="1" Grid.Row="1" Height="23" HorizontalAlignment="Left" Margin="3" 
                             Name="tituloTextBox"                             
                             VerticalAlignment="Center" Width="120" >
                        <TextBox.Text>
                            <Binding Path="Title" Mode="TwoWay" ValidatesOnExceptions="True" ValidatesOnDataErrors="True" NotifyOnValidationError="True">
                                <Binding.ValidationRules>
                                    <infValidators:EmptyStringRule></infValidators:EmptyStringRule>
                                </Binding.ValidationRules>
                            </Binding>
                        </TextBox.Text>
                    </TextBox>

                    <Label Content="Description:" Grid.Column="0" Grid.Row="2" HorizontalAlignment="Left" Margin="3" VerticalAlignment="Center" />

                    <infControls:TextEditor Height="300" Width="300"  Grid.Column="1" Grid.Row="2"  Name="txtDescription"
                                             Document="{Binding  Path=Description, Mode=TwoWay}" SpellCheckIsEnabled="True" >
                    </infControls:TextEditor>
                    <infControls:InfMediaControl Height="300" Width="200" >
                        
                    </infControls:InfMediaControl>
                    <Button Grid.Row="3" Content="Save" Command="{Binding ElementName=CategoriaExamenMgmView1, Path=DataContext.AddCommand}" CommandParameter="{Binding}"></Button>
                </Grid>
            </GroupBox>
        </Expander>
        
        <DataGrid AutoGenerateColumns="False" 
                  EnableRowVirtualization="True" 
                  Grid.Row="1"  Grid.Column="1"
                  ItemsSource="{Binding Categorias}" 
                  Name="categoriaExamDataGrid" 
                  CanUserAddRows="False" 
                  CanUserDeleteRows="False" 
                  IsSynchronizedWithCurrentItem="True"
                  RowDetailsVisibilityMode="VisibleWhenSelected" SelectionChanged="categoriaExamDataGrid_SelectionChanged">
            <DataGrid.Columns>
                <DataGridTextColumn x:Name="categoriaExamenIdColumn" Binding="{Binding Path=Id}" Header="Id" Width="SizeToHeader" Visibility="Collapsed" />
                <DataGridTextColumn x:Name="descripcionColumn" Binding="{Binding Path=Description}" Header="Description" Width="SizeToHeader" />
                <DataGridTextColumn x:Name="tituloColumn" Binding="{Binding Path=Title}" Header="Title" Width="SizeToHeader" />
            </DataGrid.Columns>
        </DataGrid>
    </Grid>
</UserControl>
